package com.jiemengshi.server.controller;

import com.jiemengshi.server.service.WechatThirdPartyService;
import com.jiemengshi.server.util.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by MingQi on 2017/7/21.
 */
@Controller
@RequestMapping(value = {"/thirdParty"}, produces = {"application/json;charset=UTF-8"})
public class WechatThirdPartyController {
    @Autowired
    private WechatThirdPartyService thirdPartyService;

    @ResponseBody
    @RequestMapping("/user/list")
    public String getMyUserInfo(){
        try {
            return ApiResult.writeData(thirdPartyService.getUserInfoList());
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResult.SYSTEM_ERROR;
        }
    }
}